#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTimer>
#include <QTreeWidget>
#include "FromMyDialog.h"
#include "Login.h"
#include "Menu.h"
#include "MySqlite.h"
#include <QThread>
#include <QChart>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
using namespace QtCharts;
class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
    QTimer loginTimer;

    static MySqlite *mySqlite;
    QThread *sqliteThread=nullptr;
signals:
    void sendServerData_signal(QString str,bool isTimer);
    void sendServerStatus(bool r);
public slots:
    void loginOutTime();
    void networkUnusual();
    void receiveServerData_slot(int function,QMap<QString,QString> kv);
    void serverStatusTimerTimeout();
private:
    Ui::MainWindow *ui;
    Login *longin=nullptr;
    FromMyDialog *menuDialog=nullptr;
    Menu *menu_=nullptr;

    QTimer serverStatusTimer;
    int serverStatusInterval=10000;//ms

};
#endif // MAINWINDOW_H
